/*
 * @Author: 迷洛洛ywc
 * @Date: 2024-02-21 17:07:15
 * @LastEditors: 迷洛洛ywc
 * @LastEditTime: 2024-06-07 10:35:03
 * @Description: file content
 */
import request from '@/utils/request'
// 农资入库
export const AddFarmStockApi = (params) =>
  request.post('/agricultural_purchase/add', params)
// 农资入库编辑
export const UpdateByFarmStockApi = (params) =>
  request.patch('/agricultural_purchase/updateById', params)
// 删除图片接口
export const delpictureApi = (params) =>
  request.post(`/deleteFile?filename=${params}`)
// 农资page查询
export const getFarmsStockPageApi = (params) =>
  request.get(`
/agricultural_inventory/page?current=${params.current}&pageSize=${params.pageSize}&remainingQuantity=${params.remainingQuantity}&type=${params.type}&name=${params.name}&baseId=${params.baseId}`)
// 农资入库记录
export const getFarmsStockPurchasePageApi = (params) =>
  request.get(
    `/agricultural_purchase/page?current=${params.current}&pageSize=${params.pageSize}&startTime=${params.startTime}&endTime=${params.endTime}&type=${params.type}&receiptType=${params.receiptType}&baseId=${params.baseId}`
  )
// 农资出库记录
export const getFarmsStockApplyPageApi = (params) =>
  request.get(
    `/agricultural_apply/page?current=${params.current}&pageSize=${params.pageSize}&startTime${params.startTime}&endTime${params.endTime}&type=${params.type}&farmingType=${params.farmingType}&baseId=${params.baseId}`
  )
// 农资详情
export function getAgriculturalDetail (params) {
  return request({
    url: '/agricultural_purchase/getDetail',
    method: 'get',
    params
  })
}
